class Instructor < ActiveRecord::Base
  has_many :timeslots
  has_many :driving_lessons, :through => :timeslots
  has_many :cancellation_reports, :through => :timeslots
  has_one :user, :as => :usable

  validates :first_anme, :presence => true
  validates :surname, :presence => true

  def full_name
    fn = [first_name, surname].compact.join(' ')
    fn = user.email if fn.blank?
    fn
  end
end
